In recent years, compression encoding technologies for moving pictures and sound have made remarkable progress and been put into practice in the fields such as broadcasting, communications and accumulation. Entropy encoding is one of the compression encoding technologies, in which a code length is varied according to an occurrence probability of a value to be encoded, thus improving an encoding efficiency. Specific examples of the known entropy encoding include Huffman encoding, arithmetic encoding and so on.
As the arithmetic encoding system, CABAC (Context-based Adaptive Binary Arithmetic Coding) that is adopted in H.264/AVC has been known, for example. The CABAC encoding is divided mainly into a probability information calculating process and a binary arithmetic encoding process.
In the probability information calculating process, according to SE (Syntax Element) to which binary data to be encoded belongs, binIdx (the location of binary data in a sequence of binary data making up SE) and a context, ctxIdx (a number specifying the probability information of the binary data) is calculated, followed by referring to and updating the probability information of the binary data specified by ctxIdx. A plurality of pieces of the probability information of the binary data are held as MPS (Most Probable Symbol: 0 or 1 having a higher occurrence probability) and pStateIdx (a number specifying an occurrence probability table).
FIG. 14 is a conceptual diagram for describing the binary arithmetic encoding process. In the binary arithmetic encoding process, a range is narrowed down between real numbers 0.0 and 1.0 according to the occurrence probability table specified by pStateIdx. The encoded data is obtained as binary expressions of real numbers specifying a final range. In practice, because a range width is secured with a limited number of digits, a process called Renormalization is added, in which, once a high-order bit in the final range is confirmed, the encoded data is outputted to broaden the range width.
The CABAC decoding is divided mainly into a probability information calculating process and a binary arithmetic decoding process. In the probability information calculating process, according to SE to which binary data to be decoded belongs, binIdx and a context, ctxIdx is calculated, followed by referring to and updating the probability information of the binary data specified by ctxIdx. A plurality of pieces of the probability information of the binary data are held as MPS and pStateIdx.
FIG. 15 is a conceptual diagram for describing the binary arithmetic decoding process. In the binary arithmetic decoding process, a range is divided into an MPS range and an LPS (Least Probable Symbol: 0 or 1 having a lower occurrence probability) range according to the occurrence probability table specified by pStateIdx. Then, based on which range includes the encoded data specifying the final range, binary data is confirmed. In practice, because a range width is secured with a limited number of digits, a process called Renormalization is added, in which, once a high-order bit in the final range is confirmed, the encoded data is read on to broaden the range width.
In the CABAC decoding, until binary data to be decoded currently is confirmed, SE to which binary data to be decoded next belongs, binIdx and the context are not confirmed. Thus, ctxIdx cannot be calculated. This makes it necessary to sequentially execute the probability information calculating process and the binary arithmetic decoding process, so that speedups are not possible.
Patent Literature (PTL) 1 discloses one method for solving this problem. In a conventional arithmetic decoding device described in PTL 1, the probability information calculating process is divided into a ctxIdx calculating process and an MPS and pStateIdx outputting process, thus pipelining the ctxIdx calculating process corresponding to next-next binary data, the MPS and pStateIdx outputting process corresponding to next binary data and the binary arithmetic decoding process corresponding to current binary data.
In the ctxIdx calculating process, ctxIdx candidates corresponding to the combinations of all the possible values of the current binary data and the next binary data are calculated. Then, once the current binary data is confirmed, ctxIdx candidates corresponding to the next-next binary data are selected. More specifically, four kinds of ctxIdx candidates satisfying (current binary data, next binary data)=(0, 0), (0, 1), (1, 0), (1, 1) are calculated. Then, once the current binary data is confirmed, two kinds of ctxIdx candidates satisfying either (current binary data, next binary data)=(0, 0), (0, 1) or (current binary data, next binary data)=(1, 0), (1, 1) are selected.
In the MPS and pStateIdx outputting process, MPS and pStateIdx candidates corresponding to the ctxIdx candidates calculated in the ctxIdx calculating process are outputted. Then, once the current binary data is confirmed, MPS and pStateIdx corresponding to the next binary data are selected. More specifically, two kinds of MPS and pStateIdx candidates having a current binary data=0, 1 are outputted, and once the current binary data is confirmed, either MPS or pStateIdx is selected.
On the other hand, the binary arithmetic decoding process confirms the current binary data according to the MPS and pStateIdx outputted by the MPS and pStateIdx outputting process.
This makes it possible to pipeline the probability information calculating process and the binary arithmetic decoding process, which have had to be executed sequentially, so that the speed of CABAC decoding can be enhanced.